'use strict';

const { Controller } = require('egg');

class MemersController extends Controller {

  async create() {
    const { ctx } = this;
    const serviceAdmin = await ctx.service.members.createOne(this);
    ctx.helper.renderSuccess(ctx, { data: serviceAdmin });
  }

  async getToken() {
    const { ctx } = this;
    const token = await ctx.service.members.getToken(this);
    ctx.helper.renderSuccess(ctx,{data: { token }});
  }

  async checkInfo() {
    const { ctx } = this;
    const ckeckRes = await ctx.service.members.checkInfo(this);
    ctx.helper.renderSuccess( ctx, { data: ckeckRes})
  }

}


module.exports = MemersController;

